/*---------------------------------------------------------
Player Row for Royal Scoreboard 1.0
---------------------------------------------------------*/

PANEL = {}

AccessorFunc( PANEL, "m_bDeleteOnClose", 	"DeleteOnClose", 	FORCE_BOOL )

/*---------------------------------------------------------

---------------------------------------------------------*/
function PANEL:Init()

self.PlayerName = vgui.Create("DLabel", self )
self.PlayerName:SetSize(80,20)
self.PlayerName:SetPos(750,5)
self.PlayerName:SetTextColor(Color(0,0,0,255))

self.Kills = vgui.Create("DLabel", self )
self.Kills:SetSize(40,20)
self.Kills:SetPos(60,5)
self.Kills:SetTextColor(Color(0,0,0,255))

self.Time = vgui.Create("DLabel", self )
self.Time:SetSize(40,20)
self.Time:SetPos(460,5)
self.Time:SetTextColor(Color(0,0,0,255))

self.Ping = vgui.Create("DLabel", self )
self.Ping:SetSize(40,20)
self.Ping:SetPos(270,5)
self.Ping:SetTextColor(Color(0,0,0,255))

self.Player = NULL
end

/*---------------------------------------------------------

---------------------------------------------------------*/

function PANEL:SetPlayer(ply)
self.Player = ply
self:UpdateDat()
end

/*---------------------------------------------------------

---------------------------------------------------------*/

function PANEL:Think()



end

/*---------------------------------------------------------

---------------------------------------------------------*/

function PANEL:UpdateDat()

   if(!IsValid(self.Player)) then return end

   local ply = self.Player
self.PlayerName:SetText(ply:Name())
self.Kills:SetText(ply:Frags())
self.Time:SetText(math.Round((CurTime() - ply:GetNWFloat("jointime"))/60))
self.Ping:SetText(ply:Ping())

end

/*---------------------------------------------------------

---------------------------------------------------------*/

function PANEL:Paint( )
if(self.Player == LocalPlayer()) then
surface.SetDrawColor(255,255,255,255)
surface.DrawOutlinedRect( 0,0,self:GetWide(),self:GetTall() )
surface.SetDrawColor( 0, 0, 255, math.Clamp(math.sin(RealTime() * 1.5) * 200, 50, 255))
surface.DrawRect(1,1,self:GetWide()-2,self:GetTall()-2)
else
surface.SetDrawColor(0,0,255,185)
surface.DrawOutlinedRect( 0,0,self:GetWide(),self:GetTall() )
surface.DrawRect(0,0,self:GetWide()-1,self:GetTall()-1)
end
end

/*---------------------------------------------------------

---------------------------------------------------------*/

function PANEL:ApplySchemeSettings( )

end

/*---------------------------------------------------------

---------------------------------------------------------*/

function PANEL:PerformLayout( )


end


vgui.Register( "quakerow", PANEL, "Panel" )